<?php
	include_once("king_head.php");
?>

<CENTER>
<H2> Add Product Percentage</H2>

<?php
	include_once("ClsSebent/config.php");

if(isset($_POST["Save"]))
{
	$profit=$_POST["profit"];
	$tax=$_POST["tax"];

	$xqry="UPDATE site_home SET tax_pct=".$tax.", pro_pct=".$profit." WHERE id=".$_SESSION['SITE_ID'];
	//echo $xqry;
	$xres=mysql_query($xqry);
	echo "<H4><FONT COLOR=red>Percentage Updated Successfully.</FONT></H4>";
}

$qry="select tax_pct, pro_pct from site_home where id=".$_SESSION['SITE_ID'];
$res=mysql_query($qry);
$result=mysql_fetch_array($res);
?>
<CENTER>
<form name=frm method=post action="default_pct.php?site_id=<?php echo $_SESSION['SITE_ID'];?>"><input type=hidden name=site_id value="<?php echo $_SESSION['SITE_ID']; ?>">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="36%" id="AutoNumber1">
  <tr>
    <td width="31%">Profit %age</td>
    <td width="69%">&nbsp;<input type="text" name="profit" size="20" value="<?php echo $result["pro_pct"];?>"></td>
  </tr>
  <tr>
    <td width="31%">Tax %age</td>
    <td width="69%">&nbsp;<input type="text" name="tax" size="20" value="<?php echo $result["tax_pct"];?>"></td>
  </tr>
  <tr>
    <td width="31%">&nbsp;</td>
    <td width="69%">&nbsp;<input type="submit" value="Save" name="Save"></td>
  </tr>
</table>
</form>	
</CENTER>


<?php
	include_once("king_foot.php");
?>